#实现学生成绩（负责列表）排序
students = [
       {"sno" : 101, "sname" : "小张", "grade" : 88},
       {"sno" : 102, "sname" : "小王", "grade" : 99},
       {"sno" : 103, "sname" : "小李", "grade" : 77},
       {"sno" : 104, "sname" : "小赵", "grade" : 66},
]

#不加reverse升序，加上降序
#lambda是匿名函数，其中x表示sudents这个字典变量中
students_sort = sorted(students, key = lambda x : x["grade"], reverse = True)
students_sort = sorted(students, key = lambda x : x["grade"])

print(f"source {students},\nsort result : {students_sort}")